-
-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(variant-group): transformer variant group changes regular express… #3211
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for unocss ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
If you agree with this, I will adjust the corresponding tests. |
I am not sure about the complexity here. Is it possible to have a simpler solution? Tests are always preferred especially with RegExp. |
Because after this adjustment, all test conditions should be wrapped on the element in order to be correctly parsed. I would like to ask first whether this method is the best way. What we should need to match is <div group-(x1 x2 )>exclude: group-(x1 x2) , so this is the solution I am currently thinking of, so all the previous regular expressions need to be corrected and placed on the attributes of the element. I feel like I can only think of using this method without using parser. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@@ -17,18 +17,29 @@ interface VariantGroup { | |||
items: HighlightAnnotation[] | |||
} | |||
|
|||
export function parseVariantGroup(str: string | MagicString, separators = ['-', ':'], depth = 5) { | |||
export function parseVariantGroup(str: string | MagicString, separators = ['-', ':'], depth = 5, type?: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where the type
used for, other than checking if it presents? Should be make a literal enum like 'shourtcut' | 'rule' | ...
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to a boolean type. It seems that I only need to determine whether I need to enable the conversion of attributes. I changed it to a boolean type. It seems that I only need to determine whether I need to enable the conversion of attributes.
Any update on this MR? would love to be able to use variant groups with ts files |
fix: #3206
I don't know if it is reasonable to filter out the matched regexClassGroup in the template in this way, or if there is a better implementation method, but this is the solution I currently think of without introducing parser.